"""
根据丹仪师姐20250114给的质控excel文件，挑选出合格的wsi

"""
import os
import shutil

import pandas as pd

excel_path = '/media/hsmy/16TB/质控合格excel/smu质控合格.xlsx'
df = pd.read_excel(excel_path, header=None, usecols=[0])
column_data = df[0].str.strip().tolist()
column_data = [str(i).replace("PA", "")[:7] for i in column_data]

# print(column_data)
wsi_folder = "/media/hsmy/16TB/20241110GIST_南方医_中六_核分裂/sm/wsi"
move_path = "/media/hsmy/16TB/20241110GIST_南方医_中六_核分裂/sm_不在质控合格单中"

wsi_no_check = []
wsi_all = []
for wsi in os.listdir(wsi_folder):
    wsi_all.append(wsi)
    wsi_path = os.path.join(wsi_folder, wsi)
    wsi_key = wsi.replace("PA", "")[:7]
    if wsi_key not in column_data:
        wsi_no_check.append(wsi)
        shutil.move(wsi_path, move_path)

print(f"总数：{len(wsi_all)}")
print(f"不在质控列表：{len(wsi_no_check)}")
print(wsi_no_check)


"""
sm
总数：261
不在质控列表：37
['PA1604857.svs', 'PA1609930.svs', 'PA1616333.svs', 'PA1621518.svs', '1102875_2021-06-09_10.ndpi', '1105420_2021-06-09_10.ndpi', '1119391_2021-06-09_10.ndpi', '1502549-1_2021-02-10_01.ndpi', '1502549-1_2021-06-09_10.ndpi', '1614219-2_2021-02-09_22.ndpi', '1614219-3-4.svs', '1614219-7-8.svs', 'PA1201822.svs', 'PA1203739.svs', 'PA1205154.svs', 'PA1206273.svs', 'PA1210639.svs', 'PA1218170.svs', 'PA1223956.svs', 'PA1300010.svs', 'PA1300290.svs', 'PA1300881.svs', 'PA1300977.svs', 'PA1302018.svs', 'PA1202715.svs', 'PA1304735.svs', '1127792_2021-06-09_10.ndpi', '1200446-3_2021-02-09_19.ndpi', 'PA1318261.svs', '1402508-6_2021-02-08_17.ndpi', '1402730-1_2021-02-08_17.ndpi', 'PA1424068.svs', 'PA1500685.svs', 'PA1510163.svs', 'PA1512642.svs', 'PA1513595.svs', 'PA1601808.svs']


"""
